package net.cyndeline.components.effect

import net.cyndeline.entitySystem.Component

/**
 * Contains the time left (in turns) an effect has before being removed.
 */
trait DurationComponent extends Component {
  
  /**
   * Number of turns left until the effect is removed.
   */
  def time: Int
  
  /**
   * Sets a new time.
   */
  def time_=(newTime: Int)
}

class Duration extends DurationComponent {
  override var time: Int = 0
  
  override def copy = {
    val copy = new Duration()
    copy.time = time
    copy
  }
}